import { createRoot } from 'react-dom/client'
import App from './App.js'
import { unstableSetRender } from 'antd-mobile'; // Support since version ^5.40.0
// 可以引入HashRouter或BrowserRouter
import { HashRouter } from 'react-router-dom';
createRoot(document.getElementById('root')).render(
  <HashRouter>
    <App />
  </HashRouter>,
)
unstableSetRender((node, container) => {
  container._reactRoot ||= createRoot(container);
  const root = container._reactRoot;
  root.render(node);
  return async () => {
    await new Promise((resolve) => setTimeout(resolve, 0));
    root.unmount();
  };
});